import 'package:flutter_deer/generated/json/base/json_convert_content.dart';
import 'package:flutter_deer/database/beans/config/res_zero_tube_entity.dart';
import 'package:flustars_flutter3/flustars_flutter3.dart';

import 'package:flutter_deer/res/constant.dart';


AppZeroModConfig $AppZeroModConfigFromJson(Map<String, dynamic> json) {
  final AppZeroModConfig appZeroModConfig = AppZeroModConfig();
  final int? mergePaymentType = jsonConvert.convert<int>(json['mergePaymentType']);
  if (mergePaymentType != null) {
    appZeroModConfig.mergePaymentType = mergePaymentType;
  }
  final double? orderMismatchAmount = jsonConvert.convert<double>(json['orderMismatchAmount']);
  if (orderMismatchAmount != null) {
    appZeroModConfig.orderMismatchAmount = orderMismatchAmount;
  }
  final int? refuelingMode = jsonConvert.convert<int>(json['refuelingMode']);
  if (refuelingMode != null) {
    appZeroModConfig.refuelingMode = refuelingMode;
  }
  return appZeroModConfig;
}

Map<String, dynamic> $AppZeroModConfigToJson(AppZeroModConfig entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['mergePaymentType'] = entity.mergePaymentType;
  data['orderMismatchAmount'] = entity.orderMismatchAmount;
  data['refuelingMode'] = entity.refuelingMode;
  return data;
}

extension AppZeroModConfigExtension on AppZeroModConfig {
  AppZeroModConfig copyWith({
    int? mergePaymentType,
    double? orderMismatchAmount,
    int? refuelingMode,
  }) {
    return AppZeroModConfig()
      ..mergePaymentType = mergePaymentType ?? this.mergePaymentType
      ..orderMismatchAmount = orderMismatchAmount ?? this.orderMismatchAmount
      ..refuelingMode = refuelingMode ?? this.refuelingMode;
  }
}